
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>赛事管理</title>
</head>
<body>
	<nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>   <span class="c-gray en">&gt;</span>赛事管理 
		<a class="btn btn-success btn-refresh radius r mr-20"
			style="line-height:1.6em;margin-top:3px" onclick="javascript:location.replace(location.href);"
			href="javascript:location.replace(location.href);" title="刷新">刷新</a>
	</nav>
	<div class="pd-20">
		<div class="mt-20"></div>
		<div class="cl pd-5 bg-1 bk-gray"> 
			<form action="<%=path%>/backstage/u_match-info-list" method="get" class="form form-horizontal" id="search-form">
			<div class="text-c">	
				<div class="row cl">
					<label class="form-label col-1">分类：</label>
					<div class="formControls col-2">
						<span class="select-box"> <select name="match_cate"
							class="select">
								<option value="-1">--不限--</option>
								<c:forEach items="${match_cates_list}" var="cate">
									<option value="${cate.item_value}" 
										<c:if test="${match_cate==cate.item_value}">selected</c:if>>${cate.display_name}
									</option>					
								</c:forEach>
						</select>
						</span>
					</div>
					
					<label class="form-label col-1">状态：</label>
					<div class="formControls col-2">
						<span class="select-box"> <select name="status"
							class="select">
								<option value="-1">--全部--</option>
								<option value="0"
									<c:if test="${status == 0}">selected</c:if>>待审核</option>
								<option value="1"
									<c:if test="${status == 1}">selected</c:if>>审核通过</option>
								<option value="2"
									<c:if test="${status == 2}">selected</c:if>>审核不通过</option>
						</select>
						</span>
					</div>							
					<button name="" id="" class="btn btn-success"
						style="border-radius: 5px; float: right;" type="submit">搜索
					</button>
					<div style="width: 10px; height: 5px; float: right;"></div>		
				</div>											
			</div>
			</form>
		</div>

		<div class="mt-20">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">                        
                        <th width="80">赛事名</th>
                        <th width="80">缩略图</th>
                        <th width="80">跳转至H5</th>
                        <th width="80">参赛名额</th>
                        <th width="80">投放金额（元）</th>                          
                        <th width="80">时间</th>
                        <th width="80">状态</th>                         
						<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${u_matchs}" var="u_match">						
						<tr class="text-c">
                             <td>${u_match.match_name}</td>
                             <td>
                             	<img src = "${u_match.thumbnail}" style="width:50px;height:50px">
                             </td>
                             <td>${u_match.thumbnail_h5}</td>
                             <td>${u_match.join_count}</td>
                             <td>${u_match.amount}</td>
                             <td>${u_match.pstart_time}
                             		至
                             	${u_match.pend_time}
                             </td>
                             <td>
	                             <c:if test="${u_match.status == 0}">
	                           		  待审核
	                           	</c:if>
	                             <c:if test="${u_match.status == 1}">
	                           		  审核通过
	                           	</c:if>
	                           	<c:if test="${u_match.status == 2}">
	                           		  审核不通过
	                           	</c:if>
                            </td>                             
							<td class="td-manage">
							<a class="btn btn-warning"
								onClick="u_match_detail(this,'${u_match.match_id}')" href="javascript:void(0);"
								title="查看详情">查看详情</a>
								&nbsp;&nbsp;&nbsp;&nbsp;						
							<a class="btn btn-warning"
								onClick="u_match_edit(this,'${u_match.match_id}')" href="javascript:void(0);"
								title="编辑">编辑</a>
								&nbsp;&nbsp;&nbsp;&nbsp;
							<a class="btn btn-warning"
								onClick="u_match_delete(this,'${u_match.match_id}')" href="javascript:void(0);"
								title="删除">删除</a>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
		$(function() {
			$('.table-sort').dataTable({
				"aaSorting" : [ [ 0, "desc" ] ],//默认第几个排序
				"bStateSave" : true,//状态保存
				"aoColumnDefs" : [
				//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				{
					"orderable" : false,
					"aTargets" : [ 1, 2 ]
				} // 制定列不参与排序
				]
			});
			
		});

		/*添加*/
		function u_match_add(title, url, w, h) {
			layer_show(title, url, w, h);
		}

		/*编辑*/
		function u_match_edit(obj,id,w,h){
			var edit_page = "<%=path%>/backstage/u_match-add-info-pre?id="+id;
			layer_show("编辑",edit_page,w,h);
		}
		
		/*查看详情*/
		function u_match_detail(obj,id,w,h){
			var info_page = "<%=path%>/backstage/u_match-detail-info-pre?id="+id;
			layer_show("查看详情",info_page,w,h);
		}

		/*删除*/
		function u_match_delete(obj,id){
			layer.confirm('确认删除？', {
				btn: ['确认','取消'], 
				shade: false
			},
			function(){
				$.ajax({
					type : "POST",
					url : "<%=path%>/backstage/u_match-delete",
					data : "id=" + id,
					error : function() {
						layer.msg('操作失败', {icon:5,time:1000});
					},
					success : function(msg) {
						layer.msg('已删除 ', {icon:6,time:1000});
						$(obj).parents("body").find(".btn-refresh").click();
					}
				});
			},
			function(){
				layer.msg('未删除', {icon:5,time:1000});
			});	
		}
	</script>
</body>
</html>



